<ol class="breadcrumb">
    <li><?php echo $this->Html->link("<i class='fa fa-dashboard'></i> Home", array('controller' => 'homes', 'action' => 'index'), array('escape' => FALSE)); ?></li>
    <li><?php echo $this->Html->link("Commandes", array('controller' => 'commandes', 'action' => 'index'), array('escape' => FALSE)); ?></li>
    <li class="active">Commandes en cours</li>
</ol>
<div id = "tableau">
    <table id = "dt" class="table table-bordered table-hover">
        <thead>
            <tr>
                <th>Login</th>
                <th>Nom</th>
                <th>Prenom</th>
                <th>Date</th>
                <th>Statut</th>
                <th></th>
            </tr>
        </thead>
        <!-- Here is where we loop through our $posts array, printing out post info -->
        <tbody>
            <?php foreach ($commandes as $c): ?>
            <tr>
                <td><?php echo $c['User']['username']; ?></td>
                <td><?php echo $c['User']['nom']; ?></td>
                <td><?php echo $c['User']['prenom']; ?></td>
                <td><?php echo $c['Commande']['date_create']; ?></td>
                <td><?php echo $c['Etat']['nom']; ?></td>
                <td><?php echo $this->Html->link("modifier",
                        array('controller' => 'commandes', 'action' => 'edit', $c['Commande']['id']), array("class" => 'btn btn-primary')); ?>
            </tr>
            <?php endforeach; ?>
        </tbody>
        <?php unset($commandes); ?>
    </table>
</div>


<?php echo $this->Html->script('dataTable', array('inline'=>false)); ?>
<?php echo $this->Html->script('filtre', array('inline'=>false)); ?>

